#ifndef __BASSBEAT_H
#define __BASSBEAT_H

#include <stdint.h>
#include <fftw3.h>

#include "light_control.h"

typedef struct
{
        fftw_plan fftwplan;
        unsigned int SAMPLESIZE;
        int rate;

        float imm[3];
        float imm_rel[3];
        float avg[3];
        float avg_rel[3];
        float long_avg[3];

        unsigned int nFrames;

        double * fWave;
        fftw_complex * fFreq;

        lightconn * l;

} sounddata;


sounddata * sounddata_init(unsigned int SAMPLESIZE, int rate);

void sounddata_destroy(sounddata * s);

sounddata * handle_sample(sounddata * s, int16_t * input_data);

#endif
